package com.example.meetdroid;

import java.util.ArrayList;

import com.example.meetdroid.R;
import com.example.meetdroid.listview.UserListAdapter;
import com.example.meetdroid.main.User;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

public class ActivityFriendList extends Activity {

	private UserListAdapter adapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_friendlist);
		setupListViewAdapter();
		
	}

	public void sendMessageToUser(View v) {
		User clickedUser = (User)v.getTag();
		
		//TODO: Session Starten
	}

	private void setupListViewAdapter() {
		adapter = new UserListAdapter(ActivityFriendList.this, R.layout.listviewrow, new ArrayList<User>());
		ListView atomPaysListView = (ListView)findViewById(R.id.mFriendListView);
		atomPaysListView.setAdapter(adapter);
		adapter.insert(new User(1,"Hans"), 0);
		adapter.insert(new User(2,"Hans II"), 0);
		adapter.insert(new User(3,"Hans III"), 0);
		adapter.insert(new User(4,"Hans IV"), 0);
	}
	
}
